const BASE_URL = "http://localhost:3000/api"; export async function registerRequest(username, password) { try { const response = await fetch(`${BASE_URL}/register`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ username, password }) }); return await response.json(); } catch (err) { console.error("API register error:", err); throw err; } }